CSharpTest.Net
Start(String[]) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Processes Namespace > ScriptRunner Class > Start Method : Start(String[]) Method

args

Glossary Item Box

Starts the process and returns.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub Start( _
   ByVal ParamArray args() As String _
) 
C# 
public void Start( 
   params string[] args
)

Parameters

args

Example

Library/Library.Test/TestScriptRunner.cs

C#Copy Code
using (ScriptRunner runner = new ScriptRunner(ScriptEngine.Language.JScript, @"WScript.StdOut.WriteLine(WScript.Arguments(0));"))
{
    StringWriter sw = new StringWriter();
    runner.OutputReceived += delegate(object o, ProcessOutputEventArgs e) { sw.WriteLine(e.Data); };
    runner.Start("From JScript");
    runner.WaitForExit();
    Assert.AreEqual(0, runner.ExitCode);
    Assert.AreEqual("From JScript", sw.ToString().Trim());
}
VB.NETCopy Code
Using runner As New ScriptRunner(ScriptEngine.Language.JScript, "WScript.StdOut.WriteLine(WScript.Arguments(0));")
    Dim sw As New StringWriter()
    runner.OutputReceived += Function(o As Object, e As ProcessOutputEventArgs) Do
        sw.WriteLine(e.Data)
    End Function
    runner.Start("From JScript")
    runner.WaitForExit()
    Assert.AreEqual(0, runner.ExitCode)
    Assert.AreEqual("From JScript", sw.ToString().Trim())
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys